{% extends "layout.html" %}
{% block css %}
<link rel="stylesheet" href="{{url_for('static', filename='css/article_add.css')}}">
{% endblock %}
{% block content %}
<div class="main-content">
    {% for item in get_flashed_messages() %}
        <div class="alert alert-danger alert-dismissible fade show" role="alert">
          <strong>错误提示!</strong> {{item[0]}}.
          <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
    {% endfor %}
    <form action="/article/add" method="post">
        {{form.hidden_tag()}}
        <div class="form-group">
            {{form.title.label()}}
            {{form.title(class="form-control")}}
        </div>
        <div class="form-group">
            {{form.category_id.label()}}
            {{form.category_id(class="form-radio-group clearfix")}}
        <div class="form-group">
            {{form.content.label()}}
            {{form.content(class="form-control", cols="30", rows="10")}}
        </div>
        <div class="form-group">
            <!--<button class="btn btn-primary">提交</button>-->
            {{form.submit(class="btn btn-primary")}}
        </div>
    </form>
</div>
{% endblock %}